package com.buddy.hadoop.hdfs;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

import java.io.IOException;

public class ReName {
    public static void main(String[] args) throws IOException {
        Configuration conf = new Configuration();
        FileSystem hdfs = FileSystem.get(conf);
        Path frpath = new Path(args[0]);
        Path topath = new Path(args[1]);
        boolean isRename = hdfs.rename(frpath,topath);
        System.out.println("修改文件名称结果："+isRename);
    }
}
